import { INCREATMENTCOUNT, DECREATMENTCOUNT,INTIMEOUTCOUNT } from '../Store/constent/countcost'
import { getMoviemsgAction } from '../Store/Actions/movieAction';
const init = {
    count: 0
}

export default function countReducer(prevState = init, action) {

    const { type, data } = action;
    switch (type) {
        case INCREATMENTCOUNT:
            return {
                ...init, count: prevState.count + data
            };
        case DECREATMENTCOUNT:
            return {
                ...init, count: prevState.count - data
            };
        case INTIMEOUTCOUNT:
            return {
                    ...init, count: prevState.count + data
            }
    }

    return prevState
}
